package main

import (
	"fmt"
	"testing"
)

func hello(num ...int) {
	num[0] = 18
}

func hi(num []int) {
	num[1] = 20
}
func Test13(t *testing.T) {
	i := []int{5, 6, 7}
	hello(i...) //可变函数是指针传递
	hi(i)       //切片是值传递，传递的参数是指针的拷贝，不会改变原始切片的长度，但是会改变底层数组的值
	fmt.Println(i[0])
	fmt.Println(i[1])
}

func main() {
	t := &testing.T{}
	Test13(t)
}
